/* 导入模块 */
import { StringValidator } from "./Validation";

/* 导出多个成员 */
export const regNumbers = /^[0-9]+$/;
export class ZipcodeValidator implements StringValidator {
    isAcceptable(s: string) {
        return s.length === 5 && regNumbers.test(s);
    }
}
console.log(new ZipcodeValidator().isAcceptable("shit"));

/* 先定义 后导出 */
// class ZipCodeValidator implements StringValidator {
//     isAcceptable(s: string) {
//         return s.length === 5 && numberRegexp.test(s);
//     }
// }
// export { ZipCodeValidator };
// export { ZipCodeValidator as mainValidator };




